home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Dr. Windows 3
/
dr win3.zip
/
dr win3
/
VISUALBA
/
SCROLVB.ZIP
/
SCROLL-X.FRM
< prev
Wrap
Text File
|
1994-02-01
|
3KB
|
102 lines
VERSION 2.00
Begin Form frmScroll
BackColor = &H00FFFF00&
BorderStyle = 0 'None
Caption = "frmScroll"
ControlBox = 0 'False
Height = 1020
Left = 2520
LinkTopic = "Form2"
MaxButton = 0 'False
MDIChild = -1 'True
MinButton = 0 'False
ScaleHeight = 41
ScaleMode = 3 'Pixel
ScaleWidth = 265
Top = 3435
Width = 4095
Begin CommandButton cmdHome
Caption = "Home"
Height = 375
Index = 0
Left = 2040
TabIndex = 1
Top = 120
Width = 1815
End
Begin CommandButton cmdStart
Caption = "Click To Start"
Height = 375
Left = 120
TabIndex = 0
Top = 120
Width = 1815
End
End
' SCROLL-X.FRM - Declarations.
DefInt A-Z
' End Of Declarations.
Sub cmdHome_Click (Index As Integer)
' All of these buttons just move the scrolling form back up to the upper
' left corner, where it was before you started scrolling.
frmScroll.Move 0, 0
End Sub
Sub cmdStart_Click ()
' Hide this button right away.
cmdStart.Visible = False
' These are the PIXEL sizes that the scrolling form will be. Any number
' up to 32000 is alright. Over that size, things get flakey!
GoalWidth = 400
GoalHeight = 400
' Since the MDI child form external size is "Twips", you must convert the
' pixel goal to Twips, and THEN actually change the form size. In other
' words, when you give VB a Width or Height value, it expects a Twip value.
'
' To get this Twip value, you multiply your pixel size goal times the
' "number of Twips per pixel". VB has a built-in "Screen" object that will
' give you that number (it varies with different monitor types).
frmScroll.Width = GoalHeight * Screen.TwipsPerPixelX
frmScroll.Height = GoalHeight * Screen.TwipsPerPixelY
' Now duplicate the "Home" command button a few times, just to have some
' other sample controls on the form. These are not critical, and can be
' removed and replaced with any other kind of control.
For temp = 1 To 15
Load cmdHome(temp)
Next temp
' Adjust all of the cmdHome buttons, including #0, which was on the form
' at design time.
For x = 0 To 3
For y = 0 To 3
' Figure out which one to move (0 to 15).
temp = (y * 4) + x
' Calculate new location.
offsetX = 10 + (x * 100)
offsetY = 30 + (y * 100)
' Move it, change caption, and show it.
cmdHome(temp).Move offsetX, offsetY, 80, 40
cmdHome(temp).Caption = "Home #" + Trim(temp)
cmdHome(temp).Visible = True
Next y
Next x
End Sub